home *** CD-ROM | disk | FTP | other *** search
/ Archive Magazine CD 1995 / Archive Magazine CD 1995.iso / discs / prog_disc / volume_1 / issue_02 / minidump7 < prev    next >
Encoding:
Text File  |  1987-10-18  |  2.0 KB  |  74 lines

  1.  
  2. ÃO.ô > MiniDump7 : A self-contained function.
  3. ÃP#Ý ¤minidump(margin%,threshold%)
  4. ÃZô The BASIC version.
  5. Ãd:
  6. Ãn:
  7. Ãx9ç margin%>79 ☓ threshold%>255 … =£ :ô Bad parameters.
  8. Ãŵ:
  9. Ã…:
  10. ÄEê left%,bottom%,right%,top%,xorigin%,yorigin%,xconvert%,yconvert%
  11. à=ê line%,x%,points%,pixel%,printcode%,strike%,colour%,vdu%
  12. ê
  13. Þ vdu% 39
  14. ô:
  15. þ:
  16. ÃÈ!(vdu%+ 0)=  4
  17. ÃÒ!(vdu%+ 4)=  5
  18. ÃÜ!(vdu%+ 8)=128
  19. Ãæ!(vdu%+12)=129
  20. Ãð!(vdu%+16)=130
  21. Ãú!(vdu%+20)=131
  22. Ä!(vdu%+24)=136
  23. Ä!(vdu%+28)=137
  24. Ä!(vdu%+32)=-1
  25. Ä"&È− "OS_ReadVduVariables",vdu%,vdu%
  26. Ä,xconvert%=!(vdu%+ 0)
  27. Ä6yconvert%=!(vdu%+ 4)
  28. Ä@left%    =!(vdu%+ 8)
  29. ÄJbottom%  =!(vdu%+12)
  30. ÄTright%   =!(vdu%+16)
  31. Ä^top%     =!(vdu%+20)
  32. Ähxorigin% =!(vdu%+24)
  33. Äryorigin% =!(vdu%+28)
  34. Ä|:
  35. Äŷ:
  36. Ä‘Hleft%  =      (left%<<xconvert%)-xorigin%    :ô These are the screen
  37. ÄŒGright% = ((right%+1)<<xconvert%)-xorigin%-1  :ô co-ordinates of the
  38. ĤHbottom%=    (bottom%<<yconvert%)-yorigin%    :ô the graphics window.
  39. Ä®3top%   =   ((top%+1)<<yconvert%)-yorigin%-1  :ô
  40. ĸ:
  41. ÄÂ:
  42. ÄÌIpoints%=(right%-left%+1)Ŵ2  :ô The number of printed points per line.
  43. ÄÖ:
  44. Äà:
  45. Äê%ô *FX 3,10 sends to printer only.
  46. Äô *FX 3,10
  47. Äþ/ï 27,64          :ô Initialise the printer.
  48. Å=ï 27,65,8        :ô 8/72" line spacing = 8 dots per line.
  49. Å/ï 27,108,margin% :ô Left margin is margin%.
  50. Å:
  51. Å&:
  52. Å0 ã line%=top% ¸ bottom% ⇦ -32
  53. Å:9ï 27,42,7,points%◰&100,points%Ŵ&100:ô Printer mode 7.
  54. ÅDã x%=left% ¸ right% ⇦ 2
  55. ÅNCprintcode%=0       :ô Initialise the value sent to the printer.
  56. ÅX9ã pixel%=7 ¸ 0 ⇦ -1 :ô Assemble 'colour' of 8 pixels.
  57. ÅbDcolour%=°x%,line%-28+(pixel%<<2))       :ô If colour% is greater
  58. ÅlHprintcode%+=(-(colour%>threshold%))<<pixel%  :ô than threshold% then
  59. Åv=í pixel%                                  :ô print a dot.
  60. Å€Fï printcode%    :ô One printhead strike prints a column of 8 dots.
  61. Å⇩í x%
  62. Å“5ï 10,13         :ô Line feed and carriage return.
  63. Åfi í line%
  64. Ũ:
  65. Ų:
  66. ż!ï 12            :ô Form feed.
  67. ÅÆ)ï 27,64         :ô Reset the printer.
  68. ÅÐ:
  69. ÅÚ1ô *FX 3,0 restores output to the screen only.
  70. Åä *FX 3,0
  71. Åî:
  72. Åø=¹
  73. Æ:
  74. ÿ